package com.gfhd.multithread.timer;

import java.util.Timer;
import java.util.TimerTask;

public class TimerDemo1 {
    public void test(){
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName()+"执行一次");
            }
        },2000,3000);
    }
}
